<%@page import="ConstInfo.AttributeName"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"
	import="java.util.*,cn.edu.hit.service.*,cn.edu.hit.javabean.Bed"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
		String username = (String) session.getAttribute("username");
		if (username == null) {
			out.print("<script>alert('您没有登录！');top.location.href='login.html';</script>");
			out.flush();
			return;
		}else{
			String admin = (String) session.getAttribute("identify");
			if (admin == null || !admin.equals("admin")) {
				out.print("<script>alert('您不是管理员！');location.href='main.html';</script>");
				out.flush();
				return;
			}
		}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>A10</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/A10cut.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.query.js"></script>
<script type="text/javascript" src="js/adminShowRoom.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	// 通过url地址获取层数的参数
	var url = parent.window.location.href;
	var floor = $.query.load(url).get("f");
	$("div[id*='A10_']").each(function(){
		var id = $(this).attr("id");
		var new_id = id.substring(0,5)+floor+id.substring(6);
		$(this).attr("id", "o_"+new_id);
		setRoomState(new_id, function(){
			showRoom(id);
		}, "black");
	});
	// 获取该层的所有房间信息
	$.post("AjaxAction!getRoomInfo.action", {
		department : "A10",
		floor : floor
	}, function(data) {
		$(data).each(function(i) {
			var func = function(){
				showRoom(data[i].room_number);
			};
			if (data[i].total == data[i].current || data[i].chooseAble == 0) {
				setRoomState(data[i].room_number, func, "black");
			} else {
				if (data[i].gender_type == '0') { //男生房间用蓝色遮罩层
					setRoomState(data[i].room_number, func, "blue");
				} else { //女生房间用红色遮罩层表示
					setRoomState(data[i].room_number, func, "red");
				}
			}
			/* if (data[i].total == data[i].current || data[i].chooseAble == 0) {
				// alert(data[i].room_number);
				var obj = $('#' + data[i].room_number);
				var offset = obj.offset();
				var color = "#FF0000";
				$("<div/>").css({
					"position" : "absolute",
					"left" : offset.left,
					"top" : offset.top,
					"width" : obj.width(),
					"height" : obj.height(),
					"backgroundColor" : color,
					"opacity" : "0.5"
				}).attr('id', 'new_' + data[i].room_number).click(function() {
					showRoom(data[i].room_number);
				}).appendTo('#__01');
			} */
		});
	}, "json");
});
</script>
</head>
<body>
	<div id="__01">		
		<div id="chooseInfo">
		<p style="margin:5px 0 0 30px"><span>当前房间：</span><span id="currentRoom">无</span></p>
		<p style="margin:5px 0 0 30px"><span>开放状态：</span><span id="roomState">无</span></p>
		<p style="margin:5px 0 0 30px"><span>房间类型：</span><span id="roomSex">无</span></p>
		<p style="margin:5px 0 0 30px"><span>空余床位：</span><span id="leftBed">无</span></p>
		<p style="margin:5px 0 0 30px">
			<button id="changeBt" disabled class="button" onclick="changeRoomState()">修改</button>
		</p>
		</div>
		<div id="bed" style="visibility: visible"></div>
		<div class="A10-L1-01" id="A10_B101_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_B101_01.gif" width="53" height="62" alt="">
		</div>
		<div class="A10-L1-02" id="A10_B103_01" onclick="showRoom(this.id,'2')">
			<img src="images/A10_B103_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-03" id="A10_B105_01" onclick="showRoom(this.id,'3')">
			<img src="images/A10_B105_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-04" id="A10_B107_01" onclick="showRoom(this.id,'3')">
			<img src="images/A10_B107_01.gif" width="54" height="62" alt="">
		</div>
		<div class="A10-L1-05">
			<img src="images/A10_L1_05.gif" width="178" height="62" alt="">
		</div>
		<div class="A10-L1-06" id="A10_B113_01" onclick="showRoom(this.id,'3')">
			<img src="images/A10_B113_01.gif" width="53" height="62" alt="">
		</div>
		<div class="A10-L1-07" id="A10_B115_01" onclick="showRoom(this.id,'2')">
			<img src="images/A10_B115_01.gif" width="54" height="62" alt="">
		</div>
		<div class="A10-L1-08" id="A10_B117_01" onclick="showRoom(this.id,'2')">
			<img src="images/A10_B117_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-09" id="A10_B119_01" onclick="showRoom(this.id,'3')">
			<img src="images/A10_B119_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-10">
			<img src="images/A10_L1_10.gif" width="600" height="11" alt="">
		</div>
		<div class="A10-L1-11" id="A10_B102_01" onclick="showRoom(this.id,'3')">
			<img src="images/A10_B102_01.gif" width="53" height="62" alt="">
		</div>
		<div class="A10-L1-12" id="A10_B104_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_B104_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-13" id="A10_B106_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_B106_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-14">
			<img src="images/A10_L1_14.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-15" id="A10_B108_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_B108_01.gif" width="50" height="62" alt="">
		</div>
		<div class="A10-L1-16" id="A10_B109_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_B109_01.gif" width="26" height="62" alt="">
		</div>
		<div class="A10-L1-17" id="A10_B110_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_B110_01.gif" width="26" height="62" alt="">
		</div>
		<div class="A10-L1-18" id="A10_B111_01" onclick="showRoom(this.id,'3')">
			<img src="images/A10_B111_01.gif" width="26" height="62" alt="">
		</div>
		<div class="A10-L1-19" id="A10_B112_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_B112_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-20">
			<img src="images/A10_L1_20.gif" width="53" height="70" alt="">
		</div>
		<div class="A10-L1-21" id="A10_B114_01" onclick="showRoom(this.id,'3')">
			<img src="images/A10_B114_01.gif" width="54" height="62" alt="">
		</div>
		<div class="A10-L1-22" id="A10_B116_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_B116_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-23" id="A10_B118_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_B118_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-24">
			<img src="images/A10_L1_24.gif" width="157" height="276" alt="">
		</div>
		<div class="A10-L1-25">
			<img src="images/A10_L1_25.gif" width="52" height="267" alt="">
		</div>
		<div class="A10-L1-26">
			<img src="images/A10_L1_26.gif" width="180" height="8" alt="">
		</div>
		<div class="A10-L1-27">
			<img src="images/A10_L1_27.gif" width="158" height="276" alt="">
		</div>
		<div class="A10-L1-28" id="A10_A101_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A101_01.gif" width="84" height="28" alt="">
		</div>
		<div class="A10-L1-29">
			<img src="images/A10_L1_29.gif" width="13" height="259" alt="">
		</div>
		<div class="A10-L1-30" id="A10_A102_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A102_01.gif" width="83" height="27" alt="">
		</div>
		<div class="A10-L1-31">
			<img src="images/A10_L1_31.gif" width="53" height="259" alt="">
		</div>
		<div class="A10-L1-32" id="A10_A104_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A104_01.gif" width="83" height="26" alt="">
		</div>
		<div class="A10-L1-33" id="A10_A103_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A103_01.gif" width="84" height="25" alt="">
		</div>
		<div class="A10-L1-34" id="A10_A105_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A105_01.gif" width="84" height="28" alt="">
		</div>
		<div class="A10-L1-35" id="A10_A106_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A106_01.gif" width="83" height="27" alt="">
		</div>
		<div class="A10-L1-36" id="A10_A107_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A107_01.gif" width="83" height="20" alt="">
		</div>
		<div class="A10-L1-37">
			<img src="images/A10_L1_37.gif" width="84" height="100" alt="">
		</div>
		<div class="A10-L1-38">
			<img src="images/A10_L1_38.gif" width="83" height="59" alt="">
		</div>
		<div class="A10-L1-39" id="A10_A108_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A108_01.gif" width="83" height="22" alt="">
		</div>
		<div class="A10-L1-40" id="A10_A109_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A109_01.gif" width="84" height="25" alt="">
		</div>
		<div class="A10-L1-41" id="A10_A110_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A110_01.gif" width="83" height="26" alt="">
		</div>
		<div class="A10-L1-42" id="A10_A111_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A111_01.gif" width="84" height="26" alt="">
		</div>
		<div class="A10-L1-43" id="A10_A112_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A112_01.gif" width="83" height="26" alt="">
		</div>
		<div class="A10-L1-44" id="A10_A113_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A113_01.gif" width="84" height="27" alt="">
		</div>
		<div class="A10-L1-45" id="A10_A114_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_A114_01.gif" width="83" height="26" alt="">
		</div>
		<div class="A10-L1-46">
			<img src="images/A10_L1_46.gif" width="52" height="71" alt="">
		</div>
		<div class="A10-L1-47">
			<img src="images/A10_L1_47.gif" width="180" height="9" alt="">
		</div>
		<div class="A10-L1-48">
			<img src="images/A10_L1_48.gif" width="53" height="71" alt="">
		</div>
		<div class="A10-L1-49" id="A10_C118_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C118_01.gif" width="53" height="62" alt="">
		</div>
		<div class="A10-L1-50" id="A10_C116_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C116_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-51" id="A10_C114_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C114_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-52" id="A10_C112_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C112_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-53" id="A10_C111_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C111_01.gif" width="29" height="74" alt="">
		</div>
		<div class="A10-L1-54" id="A10_C110_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C110_01.gif" width="28" height="74" alt="">
		</div>
		<div class="A10-L1-55" id="A10_C109_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C109_01.gif" width="27" height="74" alt="">
		</div>
		<div class="A10-L1-56" id="A10_C108_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C108_01.gif" width="44" height="62" alt="">
		</div>
		<div class="A10-L1-57" id="A10_C106_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C106_01.gif" width="53" height="62" alt="">
		</div>
		<div class="A10-L1-58" id="A10_C104_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C104_01.gif" width="52" height="62" alt="">
		</div>
		<div class="A10-L1-59" id="A10_C102_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C102_01.gif" width="53" height="62" alt="">
		</div>
		<div class="A10-L1-60">
			<img src="images/A10_L1_60.gif" width="261" height="12" alt="">
		</div>
		<div class="A10-L1-61">
			<img src="images/A10_L1_61.gif" width="255" height="12" alt="">
		</div>
		<div class="A10-L1-62" id="A10_C119_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C119_01.gif" width="53" height="60" alt="">
		</div>
		<div class="A10-L1-63" id="A10_C117_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C117_01.gif" width="52" height="60" alt="">
		</div>
		<div class="A10-L1-64" id="A10_C115_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C115_01.gif" width="52" height="60" alt="">
		</div>
		<div class="A10-L1-65" id="A10_C113_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C113_01.gif" width="53" height="60" alt="">
		</div>
		<div class="A10-L1-66">
			<img src="images/A10_L1_66.png" width="179" height="60" alt="">
		</div>
		<div class="A10-L1-67" id="A10_C107_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C107_01.gif" width="53" height="60" alt="">
		</div>
		<div class="A10-L1-68" id="A10_C105_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C105_01.gif" width="53" height="60" alt="">
		</div>
		<div class="A10-L1-69" id="A10_C103_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C103_01.gif" width="52" height="60" alt="">
		</div>
		<div class="A10-L1-70" id="A10_C101_01" onclick="showRoom(this.id,'1')">
			<img src="images/A10_C101_01.gif" width="53" height="60" alt="">
		</div>
	</div>

	<!-- End Save for Web Slices -->
	
</body>
</html>